/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.venta.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author ctrosch
 */
@Embeddable
public class MovimientoVentaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "VTRMVH_MODFOR", nullable = false, length = 2)
    private String modfor;
    @Basic(optional = false)
    @Column(name = "VTRMVH_CODFOR", nullable = false, length = 6)
    private String codfor;
    @Basic(optional = false)
    @Column(name = "VTRMVH_NROFOR", nullable = false)
    private int nrofor;

    public MovimientoVentaPK() {
    }

    public MovimientoVentaPK(String modfor, String codfor, int nrofor) {
        this.modfor = modfor;
        this.codfor = codfor;
        this.nrofor = nrofor;
    }

    public String getCodfor() {
        return codfor;
    }

    public void setCodfor(String codfor) {
        this.codfor = codfor;
    }

    public String getModfor() {
        return modfor;
    }

    public void setModfor(String modfor) {
        this.modfor = modfor;
    }

    public int getNrofor() {
        return nrofor;
    }

    public void setNrofor(int nrofor) {
        this.nrofor = nrofor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (modfor != null ? modfor.hashCode() : 0);
        hash += (codfor != null ? codfor.hashCode() : 0);
        hash += (int) nrofor;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MovimientoVentaPK)) {
            return false;
        }
        MovimientoVentaPK other = (MovimientoVentaPK) object;
        if ((this.modfor == null && other.modfor != null) || (this.modfor != null && !this.modfor.equals(other.modfor))) {
            return false;
        }
        if ((this.codfor == null && other.codfor != null) || (this.codfor != null && !this.codfor.equals(other.codfor))) {
            return false;
        }
        if (this.nrofor != other.nrofor) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.venta.modelo.MovimientoVentaPK[modfor=" + modfor + ", codfor=" + codfor + ", nrofor=" + nrofor + "]";
    }

}
